﻿using Dapper;
using DapperExtensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Logistics_Dao
{
    public class DaoBase
    {

        public string GetWhereSql(IPredicate predicate, DynamicParameters dynamicParameters)
        {
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            var wherSql = predicate.GetSql(sqlGenerator, parameters);


            foreach (var parameter in parameters)
            {
                dynamicParameters.Add(parameter.Key, parameter.Value);
            }
            return wherSql;
        }

        public DapperExtensions.Sql.ISqlGenerator sqlGenerator { get; set; }
    }
}
